# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Arkham <arkham at archlinux dot us>
# Contributor: Ivan Bobrov <ibobrik at gmail dot com>
# Contributor: Black_Mage <vleon1 at gmail dot com>

pkgname=astromenace
pkgver=1.4.2
pkgrel=1
pkgdesc="Hardcore 3D space shooter with spaceship upgrade possibilities"
arch=('loong64' 'x86_64')
url="http://www.viewizard.com/astromenace/index_linux.php"
license=('GPL3')
depends=('sdl2' 'freealut' 'libjpeg' 'libvorbis' 'glu' 'freetype2' 'libxinerama')
makedepends=('cmake' 'mesa' 'ninja')
source=("$pkgname-$pkgver".tar.gz::https://github.com/viewizard/astromenace/archive/v${pkgver}.tar.gz)
sha512sums=('6a41c987295ff7201b2a9fa748b2b246c5d61bf4ae39668e614fbec377abfe08387a66182059c0e87d1c8395aa224ae396535b0f41a0be720fc57d319249e8b0')

build() {
  cd astromenace-$pkgver

  cmake \
      -GNinja \
      -Bbuild \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DDATADIR=/usr/share/astromenace
  ninja -C build
}

package() {
  cd astromenace-$pkgver

  install -Dm755 build/astromenace "$pkgdir"/usr/bin/astromenace
  install -Dm644 build/gamedata.vfs "$pkgdir"/usr/share/astromenace/gamedata.vfs
  install -Dm644 share/astromenace_128.png "$pkgdir"/usr/share/pixmaps/astromenace.png
  install -Dm644 share/astromenace.desktop "$pkgdir"/usr/share/applications/astromenace.desktop
  install -Dm644 share/astromenace.appdata.xml "$pkgdir"/usr/share/appdata/astromenace.appdata.xml
}
